package lormi.meipin.controller.api;

import lormi.meipin.annotation.NotValidUser;
import lormi.meipin.common.Result;
import lormi.meipin.controller.BaseController;
import lormi.meipin.exception.LMException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

/**
 * 商家/个人标签模板
 * */
@RestController
@RequestMapping(value="v2/labeltemplate/",method=RequestMethod.POST,produces = "application/json; charset=utf-8")
public class LabelTemplateController extends BaseController{

	/**
	 * 获取标签模板
	 * @Param usertype 类型，1，个人，2，商家
	 * */
	@Valid
	@NotValidUser
	@RequestMapping("list")
	public String getProvinces(@NotNull(message="100033") @RequestParam(value="usertype",required=false) byte usertype) throws LMException{
		
		return Result.success(labelTemplateService.getListByUserType(usertype));
	}
	
}
